<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8"></meta>
<script type="text/javascript" src="/js/vue.js"></script>
<title>Vue.js</title>
</head>
<body>
	<h1>VON指令</h1>
	<hr></hr>
	<div id="app">
		本场比赛得分：{{score}}
		<p>
			<button v-on:click="addScore">加分</button><br/>
			<input type="text" v-on:keyup.enter="onEnter" v-model="fenshu2"></input>
		</p>
	</div>
	
	<script type="text/javascript">
		var app = new Vue({
			
			el:'#app',
			data:{
				score:0,
				fenshu2:1
			},
			methods:{
				addScore:function(){
					this.score++;
				},
				onEnter:function(){
					this.score= this.score+parseInt(this.fenshu2);
				}
			}
		});
		
	</script>
</body>
</html>